package com.lantosec.hmrp.modules.warning.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.warning.entity.WarningLog;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 *  VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="WarningLog对象", description="")
public class WarningLogVO extends BaseVO<WarningLog> {
    private static final long serialVersionUID = 1L;


    public WarningLogVO(WarningLog entity){
        this.id = entity.getId();
        this.ruleId = entity.getRuleId();
        this.startTime = entity.getStartTime();
        this.endTime = entity.getEndTime();
        this.dataNum = entity.getDataNum();
        this.nextRunTime = entity.getNextRunTime();
        this.mistiming = entity.getMistiming();
        this.ruleName = entity.getRuleName();
    }

    @Override
    public WarningLog convertToEntity(){
        return new WarningLog(this);
    }


    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "预警规则ID")
    private String ruleId;

    @ApiModelProperty(value = "预警规则运行开始时间")
    private String startTime;

    @ApiModelProperty(value = "预警规则运行结束时间")
    private String endTime;

    @ApiModelProperty(value = "预警记录数")
    private Integer dataNum;

    @ApiModelProperty(value = "下次运行时间")
    private String nextRunTime;

    @ApiModelProperty(value = "运行时长")
    private String mistiming;

    @ApiModelProperty(value = "预警规则名称")
    @TableField(exist = false)
    private String ruleName;



}
